﻿<?php
  include ("../conn.php");
  $user=$_POST['user'];
	$pwd=$_POST['pwd'];
	$sql='SELECT usename,pwd FROM admin where usename="'.$user.'" and pwd="'.$pwd.'"';
  $query=mysqli_query($con,$sql);
  if($row=mysqli_fetch_array($query,MYSQLI_ASSOC))
  { 
  	@session_start(); 	
    $_SESSION['usename']=$row['usename'];
    $_SESSION['pwd']=$row['pwd'];
    echo "<script>window.location.href='a.php?name=".$row['usename']."&&pwd=".$row['pwd']."';</script>";
  }
  else
  {
  	echo "<script>history.go(-1);</script>";
  	
  }
  
?>